package com.lyf.swing.booksys.ui;

import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @author LYF
 * @date 2022/6/23
 */
public class LoginView extends JFrame {
    private String title;
    private Integer width;
    private Integer height;
    private boolean visible;
    private ImageIcon background;

    public LoginView(String title, Integer width, Integer height,
                     boolean visible, ImageIcon background) throws HeadlessException {
        this.title = title;
        this.width = width;
        this.height = height;
        this.visible = visible;
        this.background = background;
    }
    /** 启动 */
    public void init() {
        JFrame jFrame = new JFrame();
        jFrame.setTitle(this.title);
        jFrame.setSize(this.width,this.height);
        jFrame.setLocation(400,200);

        JButton loginBtn = new JButton("LogIn",new ImageIcon());
        loginBtn.setSize(10,20);
        jFrame.add(loginBtn);


        jFrame.setVisible(this.visible);
    }

    public static void main(String[] args) {
        LoginView loginView = new LoginView("hello",800,600,true,new ImageIcon());
        loginView.init();
    }

}
